<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>PngWriter (PNGJ 2.1.0-SNAPSHOT API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="PngWriter (PNGJ 2.1.0-SNAPSHOT API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PngWriter.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../ar/com/hjg/pngj/PngReaderInt.html" title="class in ar.com.hjg.pngj"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../ar/com/hjg/pngj/PngWriterHc.html" title="class in ar.com.hjg.pngj"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?ar/com/hjg/pngj/PngWriter.html" target="_top">Frames</a></li>
<li><a href="PngWriter.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">ar.com.hjg.pngj</div>
<h2 title="Class PngWriter" class="title">Class PngWriter</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>ar.com.hjg.pngj.PngWriter</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../ar/com/hjg/pngj/PngWriterHc.html" title="class in ar.com.hjg.pngj">PngWriterHc</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">PngWriter</span>
extends <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Writes a PNG image, line by line.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#currentChunkGroup">currentChunkGroup</a></strong></code>
<div class="block">Current chunk grounp, (0-6) already read or reading</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#debuginfo">debuginfo</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#imgInfo">imgInfo</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../ar/com/hjg/pngj/pixels/PixelsWriter.html" title="class in ar.com.hjg.pngj.pixels">PixelsWriter</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#pixelsWriter">pixelsWriter</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#rowNum">rowNum</a></strong></code>
<div class="block">last writen row number, starting from 0</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#PngWriter(java.io.File, ar.com.hjg.pngj.ImageInfo)">PngWriter</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
         <a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imgInfo)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#PngWriter(java.io.File, ar.com.hjg.pngj.ImageInfo, boolean)">PngWriter</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
         <a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imgInfo,
         boolean&nbsp;allowoverwrite)</code>
<div class="block">Opens a file for writing.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#PngWriter(java.io.OutputStream, ar.com.hjg.pngj.ImageInfo)">PngWriter</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;outputStream,
         <a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imgInfo)</code>
<div class="block">Constructs a new PngWriter from a output stream.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#close()">close</a></strong>()</code>
<div class="block">Closes and releases resources</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#computeCompressionRatio()">computeCompressionRatio</a></strong>()</code>
<div class="block">Computes compressed size/raw size, approximate.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList)">copyChunksFrom</a></strong>(<a href="../../../../ar/com/hjg/pngj/chunks/ChunksList.html" title="class in ar.com.hjg.pngj.chunks">ChunksList</a>&nbsp;chunks)</code>
<div class="block">Copy all chunks from origin.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList, ar.com.hjg.pngj.chunks.ChunkPredicate)">copyChunksFrom</a></strong>(<a href="../../../../ar/com/hjg/pngj/chunks/ChunksList.html" title="class in ar.com.hjg.pngj.chunks">ChunksList</a>&nbsp;chunks,
              <a href="../../../../ar/com/hjg/pngj/chunks/ChunkPredicate.html" title="interface in ar.com.hjg.pngj.chunks">ChunkPredicate</a>&nbsp;predicate)</code>
<div class="block">Copy chunks from origin depending on some <a href="../../../../ar/com/hjg/pngj/chunks/ChunkPredicate.html" title="interface in ar.com.hjg.pngj.chunks"><code>ChunkPredicate</code></a></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList, int)">copyChunksFrom</a></strong>(<a href="../../../../ar/com/hjg/pngj/chunks/ChunksList.html" title="class in ar.com.hjg.pngj.chunks">ChunksList</a>&nbsp;chunks,
              int&nbsp;copyMask)</code>
<div class="block">Sets an origin (typically from a <a href="../../../../ar/com/hjg/pngj/PngReader.html" title="class in ar.com.hjg.pngj"><code>PngReader</code></a>) of Chunks to be copied.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../ar/com/hjg/pngj/pixels/PixelsWriter.html" title="class in ar.com.hjg.pngj.pixels">PixelsWriter</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#createPixelsWriter(ar.com.hjg.pngj.ImageInfo)">createPixelsWriter</a></strong>(<a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imginfo)</code>
<div class="block">Factory method for pixels writer.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#end()">end</a></strong>()</code>
<div class="block">Finalizes all the steps and closes the stream.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../ar/com/hjg/pngj/chunks/ChunksListForWrite.html" title="class in ar.com.hjg.pngj.chunks">ChunksListForWrite</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#getChunksList()">getChunksList</a></strong>()</code>
<div class="block">returns the chunks list (queued and writen chunks)</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#getDebuginfo()">getDebuginfo</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../ar/com/hjg/pngj/chunks/PngMetadata.html" title="class in ar.com.hjg.pngj.chunks">PngMetadata</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#getMetadata()">getMetadata</a></strong>()</code>
<div class="block">Retruns a high level wrapper over for metadata handling</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../ar/com/hjg/pngj/pixels/PixelsWriter.html" title="class in ar.com.hjg.pngj.pixels">PixelsWriter</a></code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#getPixelsWriter()">getPixelsWriter</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#queueChunk(ar.com.hjg.pngj.chunks.PngChunk)">queueChunk</a></strong>(<a href="../../../../ar/com/hjg/pngj/chunks/PngChunk.html" title="class in ar.com.hjg.pngj.chunks">PngChunk</a>&nbsp;chunk)</code>
<div class="block">Queues an ancillary chunk for writing.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#setCompLevel(int)">setCompLevel</a></strong>(int&nbsp;complevel)</code>
<div class="block">This is kept for backwards compatibility, now the PixelsWriter object should be used for
 setting compression/filtering options</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#setFilterPreserve(boolean)">setFilterPreserve</a></strong>(boolean&nbsp;filterPreserve)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#setFilterType(ar.com.hjg.pngj.FilterType)">setFilterType</a></strong>(<a href="../../../../ar/com/hjg/pngj/FilterType.html" title="enum in ar.com.hjg.pngj">FilterType</a>&nbsp;filterType)</code>
<div class="block">Sets internal prediction filter type, or strategy to choose it.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#setIdatMaxSize(int)">setIdatMaxSize</a></strong>(int&nbsp;idatMaxSize)</code>
<div class="block">Sets maximum size of IDAT fragments.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#setShouldCloseStream(boolean)">setShouldCloseStream</a></strong>(boolean&nbsp;shouldCloseStream)</code>
<div class="block">If true, output stream will be closed after ending write</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#writeRow(ar.com.hjg.pngj.IImageLine)">writeRow</a></strong>(<a href="../../../../ar/com/hjg/pngj/IImageLine.html" title="interface in ar.com.hjg.pngj">IImageLine</a>&nbsp;imgline)</code>
<div class="block">Writes next row, does not check row number.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#writeRow(ar.com.hjg.pngj.IImageLine, int)">writeRow</a></strong>(<a href="../../../../ar/com/hjg/pngj/IImageLine.html" title="interface in ar.com.hjg.pngj">IImageLine</a>&nbsp;imgline,
        int&nbsp;rownumber)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#writeRowInt(int[])">writeRowInt</a></strong>(int[]&nbsp;buf)</code>
<div class="block">Utility method, uses internaly a ImageLineInt</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../ar/com/hjg/pngj/PngWriter.html#writeRows(ar.com.hjg.pngj.IImageLineSet)">writeRows</a></strong>(<a href="../../../../ar/com/hjg/pngj/IImageLineSet.html" title="interface in ar.com.hjg.pngj">IImageLineSet</a>&lt;? extends <a href="../../../../ar/com/hjg/pngj/IImageLine.html" title="interface in ar.com.hjg.pngj">IImageLine</a>&gt;&nbsp;imglines)</code>
<div class="block">Writes the full set of row.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="imgInfo">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>imgInfo</h4>
<pre>public final&nbsp;<a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a> imgInfo</pre>
</li>
</ul>
<a name="rowNum">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rowNum</h4>
<pre>protected&nbsp;int rowNum</pre>
<div class="block">last writen row number, starting from 0</div>
</li>
</ul>
<a name="currentChunkGroup">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>currentChunkGroup</h4>
<pre>protected&nbsp;int currentChunkGroup</pre>
<div class="block">Current chunk grounp, (0-6) already read or reading
 <p>
 see <a href="../../../../ar/com/hjg/pngj/chunks/ChunksList.html" title="class in ar.com.hjg.pngj.chunks"><code>ChunksList</code></a></div>
</li>
</ul>
<a name="pixelsWriter">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pixelsWriter</h4>
<pre>protected&nbsp;<a href="../../../../ar/com/hjg/pngj/pixels/PixelsWriter.html" title="class in ar.com.hjg.pngj.pixels">PixelsWriter</a> pixelsWriter</pre>
</li>
</ul>
<a name="debuginfo">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>debuginfo</h4>
<pre>protected&nbsp;<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> debuginfo</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="PngWriter(java.io.File, ar.com.hjg.pngj.ImageInfo, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PngWriter</h4>
<pre>public&nbsp;PngWriter(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
         <a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imgInfo,
         boolean&nbsp;allowoverwrite)</pre>
<div class="block">Opens a file for writing.
 <p>
 Sets shouldCloseStream=true. For more info see <a href="../../../../ar/com/hjg/pngj/PngWriter.html#PngWriter(java.io.OutputStream, ar.com.hjg.pngj.ImageInfo)"><code>PngWriter(OutputStream, ImageInfo)</code></a></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - </dd><dd><code>imgInfo</code> - </dd><dd><code>allowoverwrite</code> - If false and file exists, an <a href="../../../../ar/com/hjg/pngj/PngjOutputException.html" title="class in ar.com.hjg.pngj"><code>PngjOutputException</code></a> is thrown</dd></dl>
</li>
</ul>
<a name="PngWriter(java.io.File, ar.com.hjg.pngj.ImageInfo)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PngWriter</h4>
<pre>public&nbsp;PngWriter(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
         <a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imgInfo)</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../ar/com/hjg/pngj/PngWriter.html#PngWriter(java.io.File, ar.com.hjg.pngj.ImageInfo, boolean)"><code>(overwrite=true)</code></a></dd></dl>
</li>
</ul>
<a name="PngWriter(java.io.OutputStream, ar.com.hjg.pngj.ImageInfo)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PngWriter</h4>
<pre>public&nbsp;PngWriter(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;outputStream,
         <a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imgInfo)</pre>
<div class="block">Constructs a new PngWriter from a output stream. After construction nothing is writen yet. You
 still can set some parameters (compression, filters) and queue chunks before start writing the
 pixels.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>outputStream</code> - Open stream for binary writing</dd><dd><code>imgInfo</code> - Basic image parameters</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="queueChunk(ar.com.hjg.pngj.chunks.PngChunk)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>queueChunk</h4>
<pre>public&nbsp;void&nbsp;queueChunk(<a href="../../../../ar/com/hjg/pngj/chunks/PngChunk.html" title="class in ar.com.hjg.pngj.chunks">PngChunk</a>&nbsp;chunk)</pre>
<div class="block">Queues an ancillary chunk for writing. 
 <p>
 If a "equivalent" chunk is already queued (see {@link ChunkHelper#equivalent(PngChunk, PngChunk)), this overwrites it. 
 <p>
 The chunk will be written as late as possible, unless the priority is set.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>chunk</code> - </dd></dl>
</li>
</ul>
<a name="copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyChunksFrom</h4>
<pre>public&nbsp;void&nbsp;copyChunksFrom(<a href="../../../../ar/com/hjg/pngj/chunks/ChunksList.html" title="class in ar.com.hjg.pngj.chunks">ChunksList</a>&nbsp;chunks,
                  int&nbsp;copyMask)</pre>
<div class="block">Sets an origin (typically from a <a href="../../../../ar/com/hjg/pngj/PngReader.html" title="class in ar.com.hjg.pngj"><code>PngReader</code></a>) of Chunks to be copied. This should be
 called only once, before starting writing the rows. It doesn't matter the current state of the
 PngReader reading, this is a live object and what matters is that when the writer writes the
 pixels (IDAT) the reader has already read them, and that when the writer ends, the reader is
 already ended (all this is very natural).
 <p>
 Apart from the copyMask, there is some addional heuristics:
 <p>
 - The chunks will be queued, but will be written as late as possible (unless you explicitly set
 priority=true)
 <p>
 - The chunk will not be queued if an "equivalent" chunk was already queued explicitly. And it
 will be overwriten another is queued explicitly.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>chunks</code> - </dd><dd><code>copyMask</code> - Some bitmask from <a href="../../../../ar/com/hjg/pngj/chunks/ChunkCopyBehaviour.html" title="class in ar.com.hjg.pngj.chunks"><code>ChunkCopyBehaviour</code></a></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../ar/com/hjg/pngj/PngWriter.html#copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList, ar.com.hjg.pngj.chunks.ChunkPredicate)"><code>copyChunksFrom(ChunksList, ChunkPredicate)</code></a></dd></dl>
</li>
</ul>
<a name="copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyChunksFrom</h4>
<pre>public&nbsp;void&nbsp;copyChunksFrom(<a href="../../../../ar/com/hjg/pngj/chunks/ChunksList.html" title="class in ar.com.hjg.pngj.chunks">ChunksList</a>&nbsp;chunks)</pre>
<div class="block">Copy all chunks from origin. See <a href="../../../../ar/com/hjg/pngj/PngWriter.html#copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList, int)"><code>copyChunksFrom(ChunksList, int)</code></a> for more info</div>
</li>
</ul>
<a name="copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList, ar.com.hjg.pngj.chunks.ChunkPredicate)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyChunksFrom</h4>
<pre>public&nbsp;void&nbsp;copyChunksFrom(<a href="../../../../ar/com/hjg/pngj/chunks/ChunksList.html" title="class in ar.com.hjg.pngj.chunks">ChunksList</a>&nbsp;chunks,
                  <a href="../../../../ar/com/hjg/pngj/chunks/ChunkPredicate.html" title="interface in ar.com.hjg.pngj.chunks">ChunkPredicate</a>&nbsp;predicate)</pre>
<div class="block">Copy chunks from origin depending on some <a href="../../../../ar/com/hjg/pngj/chunks/ChunkPredicate.html" title="interface in ar.com.hjg.pngj.chunks"><code>ChunkPredicate</code></a></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>chunks</code> - </dd><dd><code>predicate</code> - The chunks (ancillary or PLTE) will be copied if and only if predicate matches</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../ar/com/hjg/pngj/PngWriter.html#copyChunksFrom(ar.com.hjg.pngj.chunks.ChunksList, int)"><code>for more info</code></a></dd></dl>
</li>
</ul>
<a name="computeCompressionRatio()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>computeCompressionRatio</h4>
<pre>public&nbsp;double&nbsp;computeCompressionRatio()</pre>
<div class="block">Computes compressed size/raw size, approximate.
 <p>
 Actually: compressed size = total size of IDAT data , raw size = uncompressed pixel bytes =
 rows * (bytesPerRow + 1).
 
 This must be called after pngw.end()</div>
</li>
</ul>
<a name="end()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>end</h4>
<pre>public&nbsp;void&nbsp;end()</pre>
<div class="block">Finalizes all the steps and closes the stream. This must be called after writing the lines.</div>
</li>
</ul>
<a name="close()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>public&nbsp;void&nbsp;close()</pre>
<div class="block">Closes and releases resources
 <p>
 This is normally called internally from <a href="../../../../ar/com/hjg/pngj/PngWriter.html#end()"><code>end()</code></a>, you should only call this for aborting
 the writing and release resources (close the stream).
 <p>
 Idempotent and secure - never throws exceptions</div>
</li>
</ul>
<a name="getChunksList()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getChunksList</h4>
<pre>public&nbsp;<a href="../../../../ar/com/hjg/pngj/chunks/ChunksListForWrite.html" title="class in ar.com.hjg.pngj.chunks">ChunksListForWrite</a>&nbsp;getChunksList()</pre>
<div class="block">returns the chunks list (queued and writen chunks)</div>
</li>
</ul>
<a name="getMetadata()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMetadata</h4>
<pre>public&nbsp;<a href="../../../../ar/com/hjg/pngj/chunks/PngMetadata.html" title="class in ar.com.hjg.pngj.chunks">PngMetadata</a>&nbsp;getMetadata()</pre>
<div class="block">Retruns a high level wrapper over for metadata handling</div>
</li>
</ul>
<a name="setFilterType(ar.com.hjg.pngj.FilterType)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setFilterType</h4>
<pre>public&nbsp;void&nbsp;setFilterType(<a href="../../../../ar/com/hjg/pngj/FilterType.html" title="enum in ar.com.hjg.pngj">FilterType</a>&nbsp;filterType)</pre>
<div class="block">Sets internal prediction filter type, or strategy to choose it.
 <p>
 This must be called just after constructor, before starting writing.
 <p></div>
</li>
</ul>
<a name="setCompLevel(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCompLevel</h4>
<pre>public&nbsp;void&nbsp;setCompLevel(int&nbsp;complevel)</pre>
<div class="block">This is kept for backwards compatibility, now the PixelsWriter object should be used for
 setting compression/filtering options</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>compLevel</code> - between 0 (no compression, max speed) and 9 (max compression)</dd><dt><span class="strong">See Also:</span></dt><dd><code>PixelsWriter#setCompressionFactor(double)</code></dd></dl>
</li>
</ul>
<a name="setFilterPreserve(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setFilterPreserve</h4>
<pre>public&nbsp;void&nbsp;setFilterPreserve(boolean&nbsp;filterPreserve)</pre>
</li>
</ul>
<a name="setIdatMaxSize(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setIdatMaxSize</h4>
<pre>public&nbsp;void&nbsp;setIdatMaxSize(int&nbsp;idatMaxSize)</pre>
<div class="block">Sets maximum size of IDAT fragments. Incrementing this from the default has very little effect
 on compression and increments memory usage. You should rarely change this.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>idatMaxSize</code> - default=0 : use defaultSize (32K)</dd></dl>
</li>
</ul>
<a name="setShouldCloseStream(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setShouldCloseStream</h4>
<pre>public&nbsp;void&nbsp;setShouldCloseStream(boolean&nbsp;shouldCloseStream)</pre>
<div class="block">If true, output stream will be closed after ending write
 <p>
 default=true</div>
</li>
</ul>
<a name="writeRow(ar.com.hjg.pngj.IImageLine)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeRow</h4>
<pre>public&nbsp;void&nbsp;writeRow(<a href="../../../../ar/com/hjg/pngj/IImageLine.html" title="interface in ar.com.hjg.pngj">IImageLine</a>&nbsp;imgline)</pre>
<div class="block">Writes next row, does not check row number.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>imgline</code> - </dd></dl>
</li>
</ul>
<a name="writeRows(ar.com.hjg.pngj.IImageLineSet)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeRows</h4>
<pre>public&nbsp;void&nbsp;writeRows(<a href="../../../../ar/com/hjg/pngj/IImageLineSet.html" title="interface in ar.com.hjg.pngj">IImageLineSet</a>&lt;? extends <a href="../../../../ar/com/hjg/pngj/IImageLine.html" title="interface in ar.com.hjg.pngj">IImageLine</a>&gt;&nbsp;imglines)</pre>
<div class="block">Writes the full set of row. The ImageLineSet should contain (allow to acces) imgInfo.rows</div>
</li>
</ul>
<a name="writeRow(ar.com.hjg.pngj.IImageLine, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeRow</h4>
<pre>public&nbsp;void&nbsp;writeRow(<a href="../../../../ar/com/hjg/pngj/IImageLine.html" title="interface in ar.com.hjg.pngj">IImageLine</a>&nbsp;imgline,
            int&nbsp;rownumber)</pre>
</li>
</ul>
<a name="writeRowInt(int[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeRowInt</h4>
<pre>public&nbsp;void&nbsp;writeRowInt(int[]&nbsp;buf)</pre>
<div class="block">Utility method, uses internaly a ImageLineInt</div>
</li>
</ul>
<a name="createPixelsWriter(ar.com.hjg.pngj.ImageInfo)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createPixelsWriter</h4>
<pre>protected&nbsp;<a href="../../../../ar/com/hjg/pngj/pixels/PixelsWriter.html" title="class in ar.com.hjg.pngj.pixels">PixelsWriter</a>&nbsp;createPixelsWriter(<a href="../../../../ar/com/hjg/pngj/ImageInfo.html" title="class in ar.com.hjg.pngj">ImageInfo</a>&nbsp;imginfo)</pre>
<div class="block">Factory method for pixels writer. This will be called once at the moment at start writing a set
 of IDAT chunks (typically once in a normal PNG)
 
 This should be overriden if custom filtering strategies are desired. Remember to release this
 with close()</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>imginfo</code> - Might be different than that of this object (eg: APNG with subimages)</dd><dd><code>os</code> - Output stream</dd>
<dt><span class="strong">Returns:</span></dt><dd>new PixelsWriter. Don't forget to call close() when discarding it</dd></dl>
</li>
</ul>
<a name="getPixelsWriter()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPixelsWriter</h4>
<pre>public final&nbsp;<a href="../../../../ar/com/hjg/pngj/pixels/PixelsWriter.html" title="class in ar.com.hjg.pngj.pixels">PixelsWriter</a>&nbsp;getPixelsWriter()</pre>
</li>
</ul>
<a name="getDebuginfo()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getDebuginfo</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getDebuginfo()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PngWriter.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../ar/com/hjg/pngj/PngReaderInt.html" title="class in ar.com.hjg.pngj"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../ar/com/hjg/pngj/PngWriterHc.html" title="class in ar.com.hjg.pngj"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?ar/com/hjg/pngj/PngWriter.html" target="_top">Frames</a></li>
<li><a href="PngWriter.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2014. All rights reserved.</small></p>
</body>
</html>
